FROM apache/skywalking-java-agent:8.5.0-jdk8
ADD target/gateway-0.0.1-SNAPSHOT.jar gateway.jar
ENV JAVA_OPTS="-Xms128m -Xmx512m -Xss512k -Dskywalking.agent.service_name=cloud-gateway -Dskywalking.collector.backend_service=skywalking:11800 -javaagent:/skywalking/agent/skywalking-agent.jar"
RUN apk add tzdata
ENV TZ Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
EXPOSE 8888:8888
RUN mv agent/optional-plugins/apm-spring-cloud-gateway-2.1.x-plugin-8.5.0.jar agent/plugins/ \
    && mv agent/optional-plugins/apm-spring-webflux-5.x-plugin-8.5.0.jar agent/plugins/
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar gateway.jar" ]